/*
 * @Author: zyp yangpeng.zhang@fts.aero
 * @Date: 2024-06-04 10:02:53
 * @LastEditors: zyp yangpeng.zhang@fts.aero
 * @LastEditTime: 2024-07-01 14:43:06
 * @FilePath: \vue3-dynamic-module\src\modules\Movie\index.ts
 * @Description: 程式描述
 */
import movie from './index.vue';
import detail from './detail/index.vue';
import Icon from './icon.svg?component';

export default {
  config: {
    name: 'Movie',
    ref: markRaw(movie),
    position: 'FOOTER_TABBAR',
    type: 'PAGE',
    sort: 0,
    icon: markRaw(Icon),
    path: '/movie',
  },
  install(app: any, options?: any) {
    console.log('注册-电影-模块', this.config)
    // options.router.addRoute('Home', {
    //   path: 'movie',
    //   name: this.config.name,
    //   meta: { title: '电影', keepAlive: true, icon: '' },
    //   component: movie
    // });
    app.config.globalProperties[`MovieRouterTree`] = {
      path: this.config.path,
      component: options.Layout,
      meta: { title: '电影', icon: '', },
      name: 'Movie',
      children: [
        {
          path: '',
          meta: { title: '电影', keepAlive: true, icon: '' },
          name: "MovieMain",
          compurl: './Movie/index.vue',
          component: movie
        },
        {
          path: 'detail',
          meta: { title: '电影详情', keepAlive: true, icon: '' },
          name: "MovieDetail",
          compurl: './Movie/detail/index.vue',
          component: detail
        },
      ]
    };
    app.component(this.config.name, movie);
  }
}
